package com.health.userbackstage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.userbackstage.pojo.Permission;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermissionMapper extends BaseMapper<Permission> {

    @Select("SELECT p.*,r.`keyword` rname\n" +
            "FROM role r,role_permission rp,permission p\n" +
            "WHERE r.`id`=rp.`role_id` AND p.`id`=rp.`permission_id`")
    @ResultMap("permissionMap")
    List<Permission> findAll();

}
